﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pavilion.Communications;

namespace Pavilion.DesignerTool
{
    static class AnimationTransfer
    {
        static public void Add(string resourceName, AnimationData animationData)
        {
            DataTransferClient.Instance.TransferData((proxy) => proxy.InsertAnimation(resourceName, animationData.Name));

            foreach (FrameData frameData in animationData.FrameDataCollection)
                FrameTransfer.Insert(frameData);
        }

        static public void Remove(string resourceName, string animationName)
        {
            DataTransferClient.Instance.TransferData((proxy) => proxy.RemoveAnimation(resourceName, animationName));
        }

        static public void Rename(string resourceName, string oldName, string newName)
        {
            DataTransferClient.Instance.TransferData((proxy) => proxy.RenameAnimation(resourceName, oldName, newName));
        }
    }
}
